<include file="./top" />

<!-- start: Header -->
<include file="./head" />
<!-- end: Header -->

<div class="container-fluid content">
<div class="row"> 
  <!-- start: Main Menu --> 
  <include file="./slide" /> 
  <!-- end: Main Menu --> 
  
  <!-- start: Content -->
  <div class="main sidebar-minified"> 
    <!--div class="row">
      <div class="col-lg-12">
        <h3 class="page-header"><i class="fa fa-table"></i>{$title}</h3>
      </div>
    </div-->
    <div class="row">
      <div class="col-lg-8">
        <div class="panel panel-default">
          <div class="panel-heading">
            <h2><i class="fa fa-table red"></i><span class="break"></span><strong>{$title}</strong></h2>
            <div class="panel-actions"> <a href="table.html#" class="btn-setting"><i class="fa fa-rotate-right"></i></a> <a href="table.html#" class="btn-minimize"><i class="fa fa-chevron-up"></i></a> </div>
          </div>
          <div class="panel-body">
            <table class="table table-striped table-bordered bootstrap-datatable datatable">
              <thead>
                <tr>
                  <th width="4%">ID</th>
                  <th width="10%">IP</th>
                  <th width="15%">添加时间</th>
                  <th>加黑原因</th>
                  <th width="10%">拦截次数</th>
                  <th width="8%">操作</th>
                </tr>
              </thead>
              <tbody>
                <?php foreach($log as $v): ?>
                <tr>
                  <td>{$v['id']}</td>
                  <td>{:long2ip($v['ip'])}</td>
                  <td>{:date("Y-m-d H:i:s",$v['time'])}</td>
                  <td>{$v['content']}</td>
                  <td>{$v["num"]}</td>
                  <td><a class="btn btn-danger" href="{:U('Jifei/del_block_ip',array('id'=>$v['id']))}" onclick="javascript:return p_del('黑名单IP')"> <i class="fa fa-trash-o "></i></a></td>

                </tr>
                <?php endforeach;?>
              </tbody>
            </table>
          </div>
         <?php if(!empty($page)){?>
         <div class="panel-body">
          <ul class="pagination">
            <?php echo $page; ?>
          </ul>
         </div>
         <?php } ?>

        </div>
      </div>
    </div>

<div class="row">
      <div class="col-lg-8">
        <div class="panel panel-default">
        <div class="panel-heading">
          <h2><i class="fa fa-indent red"></i><strong>添加黑名单IP</strong></h2>
        </div>
        <div class="panel-body">
        <form action="{:U('Jifei/add_block_ip')}" method="post" class="form-horizontal ">
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-small">IP</label>
            <div class="col-sm-6">
              <input type="text" id="input-small" name="ip" class="form-control input-sm" placeholder="填写IP">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-large">加黑原因</label>
            <div class="col-sm-6">
         
              <textarea class="form-control" name="content" placeholder="填写加黑原因"></textarea>
            </div>
          </div>
          </div>
          <div class="panel-footer">
          <div class="row">
           <div class="col-sm-2"></div>
           <div class="col-sm-6"> <button type="submit" class="btn btn-success active"><i class="fa fa-dot-circle-o"></i>添加</button></div>
           </div>
          </div>
          </div>
        </form>
      </div>
    </div>
    

  </div>
</div>
<include file="./foot" />
<style type="text/css">
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 45%; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
.ui-timepicker-rtl dl dt{ float: right; clear: right; }
.ui-timepicker-rtl dl dd { margin: 0 45% 10px 10px; }
</style>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/jq_time/jquery-ui.css" />
<script type="text/javascript" src="__PUBLIC__/jq_time/jquery-ui-1.10.4.custom.min.js"></script> 
<script type="text/javascript" src="__PUBLIC__/jq_time/jquery.ui.datepicker-zh-CN.js"></script> 
<script type="text/javascript" src="__PUBLIC__/jq_time/jquery-ui-timepicker-addon.js"></script> 
<script type="text/javascript" src="__PUBLIC__/jq_time/jquery-ui-timepicker-zh-CN.js"></script> 
<script type="text/javascript">
$(function(){
    $( "input[name='act_start_time'],input[name='act_stop_time']" ).datetimepicker();
    $("#but").click(function(){
            var act_start_time= $("#act_start_time").val();
		    var act_stop_time= $("#act_stop_time").val();
			var selects = $("#select").val();
			var nr = $("#nr").val();
			if(selects==0 && nr==''){
			   	if(!act_start_time && !act_stop_time){ 
			     yz_alert(0,"查询时间或者查询值必须写一个!");
				 return false;
			    }
			}	
		 });
    //删除
	$("#del").click(function(){
			var act_start_time= $("#act_start_time").val();
			var act_stop_time= $("#act_stop_time").val();
			var selects = $("#select").val();
			var nr = $("#nr").val();
			var info = '确认删除';
		    if(selects==0 && nr==''){
			   	if(!act_start_time && !act_stop_time){ 
			     yz_alert(0,"删除日志时间或者查询值必须写一个!");
				 return false;
			    }
			}else{ 
			 info = info+selects+"等于"+nr+"  ";
			}
		    if(act_start_time && act_stop_time){ 
			  info = info + act_start_time+"到"+act_stop_time;
			 }
			info = info +"的拦截日志吗???";
			if (confirm(info)==true){   
                $.ajax({
					 type:'GET',
					 url:'{:U("Jifei/del_lanjie_log")}',
					 data:{"act_start_time":act_start_time,"act_stop_time":act_stop_time,"selects":selects,'nr':nr},
					 dataType:"json",
					 success: function(data){
						var data = eval(data);
						yz_alert(data.status,data.info);
				     }
				  })   
             }
		});
});
</script>
</body>
</html>
